<template>
  <div class="layout">
    <div class="box">
      <keep-alive>
        <router-view v-if="$route.meta.keepAlive"></router-view>
      </keep-alive>
      <router-view v-if="!$route.meta.keepAlive"></router-view>
<!-- 面试题：kwwp-alive的理解
1.他是做路由缓存
2.他有两个钩子函数 deactivated avtibated     只有被keep-alive包裹的或者被缓存的才会触发
3.有三个属性 exclude   include    max -->
    </div>
    
    <ul>
      <li>
        <router-link to="/shouye">首页</router-link>
      </li>

      <li>
        <router-link to="/shoucang">收藏</router-link>
      </li>

      <li>
        <router-link to="/xihuan">喜欢</router-link>
      </li>

      <li>
        <router-link to="/wode">我的</router-link>
      </li>
    </ul>
  </div>
</template>
<script>
export default {
  name: 'layout',
  data () {
    return {
    }
  },
  created () {
  },
  computed: {
  },
  methods: {
      
  }
}
</script>
<style lang='less'  scoped>
.layout {
  height: 100vh;
  display: flex;
  justify-content: space-between;
  flex-direction: column;
  .box {
    flex: 1;
    overflow: auto;
  }
  ul {
    height: 50px;
    background-color: #fff;
    list-style: none;
    display: flex;
    width: 100%;
    li {
      margin: 10px 0;
      flex: 1;
      text-align: center;
    }
  }
}
</style>
